<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>计算文件MD5</title>
    <style>
        .box {
            display: block;
            margin: 20px;
            padding: 20px;
            box-shadow: 0 0 13px 0px #0000006b;
            border-radius: 10px;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="box">
            <div><input type="file" multiple id="file" @change="showFileList" /></div>
            <div id="time">当前时间：{{time}}</div>
            <div><button @click="onStart1" :disabled="loading">开始计算</button></div>
            <div><button @click="onStart2" :disabled="loading">开始计算(web-worker)</button></div>
            <div><button @click="onStart3" :disabled="loading">开始计算(wasm+web-worker)</button></div>
            <div><button @click="onStart4" :disabled="loading">开始计算(fid)</button></div>
        </div>
        <div class="box" v-for="item in list">
            <div>文件名:{{item.name}}</div>
            <div>大小:{{item.size}}GB</div>
            <div>用时:{{item.md5=='--'?'未开始':item.per>=100?item.useTime: ((new Date().valueOf() - item.start) / 1000)}}s
            </div>
            <div>MD5:{{item.md5}}</div>
            <div>进度：<progress :value="item.per" max="100"></progress> {{item.per}}</div>
        </div>
    </div>
    <script src="./spark-md5.min.js"></script>
    <script src="./vue.min-2.4.js"></script>
    <script src="./util.js"></script>
    <script src="./index.js"></script>
</body>

</html>